<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
<title>后台管理系统</title>
    <link rel="stylesheet" type="text/css" href="../../common/css/common.css">
    <link href="../../common/ui/css/admin/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <link href="../../common/ui/css/admin/style.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" type="text/css" href="../../common/js/jquery-treetable/jquery.treetable.css">
    <link rel="stylesheet" href="../../common/js/jquery-treetable/jquery.treetable.theme.default.css"/>
    <link rel="stylesheet" type="text/css" href="./menu.css">
</head>
<body>
<div class="loading" id="loading">
    <div class="spinner">
        <div class="double-bounce1"></div>
        <div class="double-bounce2"></div>
    </div>
</div>
<div id="tips"></div>
<div class="page">
    <div id="toolBox">
    </div>
    <table id="tree-basic">
    </table>
</div>

<script type="text/template" id="buttonTemplate">
    <%if($.inArray("/resource-post",resourceData) > -1){%>
    <button class="add-btn btn btn-primary btn-xs"><i class="fa fa-plus" aria-hidden="true"></i> 添加</button>
    <%}%>
</script>
<script type="text/template" id="treeTemplate">
    <thead>
    <tr>
        <th>资源名称</th>
        <th>URL</th>
        <th>METHOD</th>
        <th>类型</th>
        <th>排序</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody class="tree-body">
    <%for(var i = 0; i < list.length; i ++){%>
    <tr data-tt-id="<%=list[i].id%>"
    <%if(typeof list[i].pid != "undefined"){%>data-tt-parent-id="<%=list[i].pid%>"<%}%>>
    <td><%=list[i].name%></td>
    <td><%=list[i].url%></td>
    <td><%=list[i].method%></td>
    <td><%=list[i].type=="1"?"功能":"菜单"%></td>
    <td><%=list[i].sort%></td>
    <td>
        <%if($.inArray("/resource-put",resourceData) > -1){%><a data-id="<%=list[i].id%>"
                                                                class="edit-btn btn btn-xs btn-primary pointer"><i
            class='fa fa-pencil' aria-hidden='true'></i> 编辑</a><%}%>
        <%if($.inArray("/resource/*-delete",resourceData) > -1){%><a data-id="<%=list[i].id%>"
                                                                     class="del-btn btn btn-xs btn-danger pointer"><i
            class='fa fa-trash-o' aria-hidden='true'></i> 删除</a><%}%>
    </td>
    </tr>
    <%}%>
    </tbody>
</script>

<script src="../../common/js/base.min.js"></script>
<script type="text/javascript" src="../../common/js/sea.js"></script>
<script type="text/javascript" src="../../common/js/utils.js"></script>
<script type="text/javascript" src="../../common/js/common.js"></script>
<script type="text/javascript" src="../../common/js/jquery-treetable/jquery.treetable.js"></script>
<script seajs type="text/javascript" src="./menu.js"></script>
</body>
</html>